#include <cstdio>
#include <cmath>

bool isPrime(int n) {
    bool flag = true;
    for (int i = 2; i <= sqrt(n); i++) {
        if (n % i == 0) {
            flag = false;
        }
    }
    return flag;
}

int main() {
    const int MAX = 100000;
    int N, count = 0;
    int prime[MAX+10] = {0};
    int sum = 0;

    scanf("%d", &N);
    for (int i = 1; i <= N; i++) {
        if (isPrime(i)) {
            prime[count++] = i;
            if (prime[count-1] - prime[count-2] == 2) sum++;
        }
    }
    printf("%d\n", sum);

}